package top.codecrab.eblog.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import top.codecrab.eblog.common.response.R;
import top.codecrab.eblog.vo.SignRankVo;
import top.codecrab.eblog.vo.SignVo;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author codecrab
 * @since 2022-03-18
 */
@Controller
@RequestMapping("/sign")
public class SignController extends BaseController {

    @ResponseBody
    @PostMapping("/in")
    public R signIn() {
        SignVo signVo = signService.saveSignIn(request);
        return R.ok(signVo);
    }

    @ResponseBody
    @GetMapping("/rank")
    public R rank() {
        List<List<SignRankVo>> rankList = signService.signRankList();
        return R.ok(rankList);
    }

}
